package com.example.zthdemo3.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.zthdemo3.Until.Result;
import com.example.zthdemo3.service.IEmpService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhengtianheng
 * @since 2023-03-08
 */
@RestController
@RequestMapping("/emp")
@CrossOrigin
public class EmpController {

    @Resource
    public IEmpService empService;

    @GetMapping("selAll")
    public Result findAll(Integer current,Integer size) {
        Page page = new Page(current, size);
        Page  list = empService.finAll(page);
        return new Result(list);
    }



    @DeleteMapping("{id}")
    public Result delEmp(@PathVariable Integer id){
        return new Result(empService.removeById(id));
    }

}

